# -*- coding: utf-8 -*-
# @Time     : 2021/11/29 21:43
# @Author   : wljess
# @File     : Process进程创建.py
# @Describe : 
# @Software : PyCharm

import os
from multiprocessing import Process


def task(name):
    print(f"子进程pid: {os.getpid()}， 父进程id:{os.getpid()}")
    print(f"we ary singing {name}...")


if __name__ == '__main__':
    print(f"主进程id:{os.getpid()}")
    p = Process(target=task, args=("黄种人",))
    p.start()  # 异步  调用开启进程的方法，但是并不等待这个进程真的开启

    print("主进程运行中...")
